﻿<UserControl x:Class="TimeKeeper.Views.ProjectTimesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
             xmlns:cal="http://www.caliburnproject.org"
             mc:Ignorable="d"
             d:DesignHeight="208" d:DesignWidth="357">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <ListBox Grid.Row="1" x:Name="Project_TimeOnProject" Margin="4">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Date, StringFormat={}{0:dd.MM. yyyy}}" VerticalAlignment="Center" />
                        <TextBlock Text=" - " VerticalAlignment="Center"/>
                        <TextBlock Text="{Binding Time}" VerticalAlignment="Center" />
                        <TextBlock Text="hrs" VerticalAlignment="Center"/>
                        <Button x:Name="EditTime" Content="Edit" cal:Message.Attach="EditTime($dataContext)" Margin="4" VerticalAlignment="Center"/>
                        <Button x:Name="DeleteTime" Content="Delete" cal:Message.Attach="DeleteTime($dataContext)" Margin="4" VerticalAlignment="Center"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" x:Name="Project_Name" DockPanel.Dock="Top" Margin="4" Text="Project Name"/>
            <TextBlock Grid.Row="1" x:Name="Project_Description" TextWrapping="Wrap" Margin="4" Text="Description of project may contain some really long piece of self explanatory text."/>
            <StackPanel Grid.Row="2" Orientation="Horizontal">
                <Button x:Name="AddTime" Content="Add" Margin="4"/>
                <Button x:Name="EditProject" Content="Edit details" Margin="4" />
                <Button x:Name="DeleteProject" Content="Delete" Margin="4" />
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
